/* 
 * Copyright [2018] [Alex/libo(liboware@gmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.infodb.bean.po;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.format.annotation.DateTimeFormat;


/**
 * @author LiBo/Alex
 * @version V1.0 
 * <p>base po data persistence object </p>
 */
@Data
@Accessors(chain=true)
@MappedSuperclass
public class LongPO implements Serializable {

    /**  
     * @fieldName serialVersionUID
     * @fieldType long
     */ 
    private static final long serialVersionUID = 835521985612434021L;

    /**  
     * <p>主键ID</p> 
     * @fieldName id
     * @fieldType Long
     */ 
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public Long id;
    
    /**  
     * <p>创建时间</p> 
     * @fieldName createDate
     * @fieldType Date
     */
    @Column(name="CREATE_DATE")
    @CreationTimestamp
    @DateTimeFormat(style="yyyy-MM-dd HH:mm:ss")
    public Date createDate;
    
    /**  
     * <p>修改时间</p> 
     * @fieldName editDate
     * @fieldType Date
     */
    @Column(name="EDIT_DATE")
    @DateTimeFormat(style="yyyy-MM-dd HH:mm:ss")
    @UpdateTimestamp
    public Date editDate;
    
    /**  
     * <p>用户ID</p> 
     * @fieldName userId
     * @fieldType Long
     */ 
    @Column(name="USER_ID",length=16)
    private Long userId;
    
}
